package com.exam.netease;

import java.util.Scanner;

/**
 * date:
 * description:
 */
public class Solution003 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] tree = new int[n];
        for (int i = 0; i < n; i++) {
            tree[i] = i + 1;
        }
        int k = 0;
        conv(tree, k);
        for (int i = 0; i < n; i++) {
            System.out.print(tree[i] + " ");
        }
    }

    public static void conv(int[] tree, int k){
        if(k >= tree.length){
            return;
        }
        int left = 2 * k + 1;
        int right = 2 * k + 2;
        if(right >= tree.length){
            return;
        }
        if((tree[k] & 1) == 1){
            if((tree[left] & 1) == 1){
                swap(tree, k, right);
            }else{
                swap(tree, k, left);
            }
        }
        conv(tree, left);
        conv(tree, right);
    }


    public static void swap(int[] nums, int a, int b){
        int tmp = nums[a];
        nums[a] = nums[b];
        nums[b] = tmp;
    }

}
